import request from '@utils/request'

// 劳动教育分页查询
export function getCourse (data) {
  return request({
    url: '/laborEducation/getPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 删除劳动教育
export function removeCourse (data) {
  return request({
    url: '/laborEducation/delLabor',
    method: 'get',
    params: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 新增劳动教育
export function addCourse (data) {
  return request({
    url: '/laborEducation/addLabor',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 修改劳动教育
export function changeCourse (data) {
  return request({
    url: '/laborEducation/updateLabor',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 查询活动成员
export function getMember (data) {
  return request({
    url: '/laborEducation/getUserList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 新增活动成员
export function addMember (data) {
  return request({
    url: '/laborEducation/addRecord',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 查询活动任务/作业
export function getCourseWork (data) {
  return request({
    url: '/laborEducation/getLaborTaskList',
    method: 'get',
    params: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 查询活动任务/作业 提交人列表
export function getCourseWorkSubmit (data) {
  return request({
    url: '/laborEducation/getTaskDetail',
    method: 'get',
    params: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 查询活动任务/作业 评分
export function giveNum (data) {
  return request({
    url: '/laborEducation/changeSumbit',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 新增活动任务/作业
export function addCourseWork (data) {
  return request({
    url: '/laborEducation/addTask',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}


// 成员管理  查看任务/作业
export function getUserSumbit (data) {
  return request({
    url: '/laborEducation/getUserSumbit',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}


// 导出信息
export function exportEducation (data) {
  return request({
    url: '/laborEducation/export',
    method: 'get',
    params: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}